	// 不含icon提示框
	const toast = str => {
	  return new Promise((resolve, reject) => {
	    uni.showToast({
	      title: str,
	      icon: "none",
	      duration: 2000,
	      success: () => {
	        setTimeout(() => {
	          resolve()
	        }, 2000)
	      }
	    })
	  })
	};
	// 成功提示框
	const successToast = str => {
	  return new Promise((resolve, reject) => {
	    uni.showToast({
	      title: str,
	      icon: "success",
	      duration: 2000,
	      success: () => {
	        setTimeout(() => {
	          resolve()
	        }, 2000)
	      }
	    })
	  })
	};
  // 错误提示框
  const errorToast = str => {
    return new Promise((resolve, reject) => {
      uni.showToast({
        title: str,
        icon: "error",
        duration: 2000,
        success: () => {
          setTimeout(() => {
            resolve()
          }, 2000)
        }
      })
    })
  };
	// loading
	const showLoading = () => {
	  return new Promise((resolve, reject) => {
	    uni.showLoading({
	      success: () => {
	        resolve()
	      }
	    })
	  })
	};
	// tipLoading ==>提示loading
	const tipLoading = str => {
	  return new Promise((resolve, reject) => {
	    uni.showLoading({
	      title: str,
	      success: () => {
	        resolve()
	      }
	    })
	  })
	};
	// 隐藏loading
	const hideLoading = () => {
	  return new Promise((resolve, reject) => {
	    uni.hideLoading({
	      success: () => {
	        resolve()
	      }
	    })
	  })
	};
	// 手机号分隔显示
	const intervalPhone = (phone) => {
	  return (phone.toString()).replace(/\s/g, '').replace(/(^\d{3})(?=\d)/g, "$1 ").replace(/(\d{4})(?=\d)/g, "$1 ");
	}
	// 手机号脱敏
	const desensitizationPhone = (phone) => {
	  return (phone.toString()).replace(/(\d{3})\d*(\d{4})/, '$1****$2');
	}
	// 姓名脱敏
	const desensitizationName = (str) => {
	  if (str == null || str == undefined || str.length == 0) {
	    return ''
	  }
	  if (str.length == 1) {
	    return str
	  }
	  if (str.length == 2) {
	    return str.substring(0, 1) + '*'
	  }
	  let starStr = ''
	  for (let index = 0; index < str.length - 2; index++) {
	    starStr += "*"
	  }
	  return str.substring(0, 1) + starStr + str.substring(str.length - 1, str.length)
	}
	export default {
	  toast: toast,
	  successToast: successToast,
    errorToast: errorToast,
	  showLoading: showLoading,
	  tipLoading: tipLoading,
	  hideLoading: hideLoading,
	  intervalPhone: intervalPhone,
	  desensitizationPhone: desensitizationPhone,
    desensitizationName:desensitizationName
	}
